#include <iostream>
using namespace std;
int const N=6;
int main()
{int i,j,m,x,y;
 int a[N]={-2,11,-4,13,-5,-2};
 m=a[0]+a[1];
 for(i=0;i<=N-2;i++)
   { for(j=i+1;j<=N-1;j++)
           if (a[i]+a[j]>=m)  
           {m=a[i]+a[j];
            x=i,y=j;
            }
   }
 cout<<"m="<<m<<endl;
 cout<<"i="<<x+1<<" "<<"j="<<y+1<<endl;
 system ("pause");
 return 0;
}
